﻿using DL.Characters.Player.FSM.Data;
using DL.Characters.Player.FSM.StateMachine;
using DL.Combat;
using DL.Combat.Base;
using DL.Movement;
using UnityEngine;

namespace DL.Characters.Player.FSM.State
{
    public class PlayerCombatBaseState : PlayerState
    {
        protected PlayerCombatStateMachine StateMachine { get; }
        protected Transform Self { get;}
        protected RuntimeReusableData ReusableData { get; }
        protected Animator Animator { get; }
        protected PlayerMoveController MoveController { get; }
        protected PlayerBaseAttackCombatController CombatController { get; }
        protected PlayerBaseWeaponAttackCombatController WeaponCombotController { get; }

        public PlayerCombatBaseState(PlayerCombatStateMachine playerStateMachine, int property = 0) : base(property)
        {
            StateMachine = playerStateMachine;
            Self = StateMachine.Player.Self;
            ReusableData = StateMachine.Player.RuntimeReusableData;
            Animator = StateMachine.Player.Animator;
            MoveController = StateMachine.MovementController;
            CombatController =  StateMachine.CombatController;
            WeaponCombotController = StateMachine.WeaponCombotController; 
        }

        public override void Update()
        {
            WeaponCombotController.TryLookEnemy();
        }
    }
}